//
//  JobSeekerMainViewController.m
//  MyProject
//
//  Created by 石小强 on 2018/5/9.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "JobSeekerMainViewController.h"
#import "JobSeekerMainCell.h"

@interface JobSeekerMainViewController ()

@end

@implementation JobSeekerMainViewController {
    NSInteger _pageNo;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    [self setupTableView];
    
//    [self.tableView.mj_header beginRefreshing];
}

- (void)setupTableView {
//    self.headView.frame = CGRectMake(0, 0, kScreenWidth, 909);
    self.tableHeaderView.frame = CGRectMake(0, 0, kScreenWidth, 192);
    self.tableView.tableHeaderView = self.tableHeaderView;
    [self.tableView registerNib:[UINib nibWithNibName:@"JobSeekerMainCell" bundle:nil] forCellReuseIdentifier:@"JobSeekerMainCell"];
    self.tableView.tableFooterView = [[UIView alloc]init];
    self.tableView.estimatedRowHeight = 184.0f;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        // Fallback on earlier versions
    }
    
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        _pageNo = 1;
    }];
    self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
        _pageNo += 1;
    }];
}

#pragma mark - UITableViewDataSource, UITableViewDelegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JobSeekerMainCell *cell = [tableView dequeueReusableCellWithIdentifier:@"JobSeekerMainCell"];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    if (indexPath.row == 2) {
        cell.titleL.text = @"录用通知书有法律效力吗？";
        cell.tagL.text = @"解密专题";
    } else if (indexPath.row == 3) {
        cell.replyL.text = @"";
    }
    
    return cell;
}

@end
